package com.fengshang.wedding.domain.model.api;

import java.util.Date;
/**
 * 
 *@author gembin@gmail.com
 * 
 */
public class Topic implements ITopic {

	private int id;
	private String title;
	private Date postDate;
	private String content;
	private VisibilityLevel visibilityLevel=VisibilityLevel.NONE;
	private IUser owner;
	
	public Topic() {

	}

	public Topic(ITopic topic) {
		if (topic != null) {
			this.id = topic.getId();
			this.title = topic.getTitle();
			this.postDate = topic.getPostDate();
			this.content = topic.getContent();
			this.visibilityLevel = topic.getVisibilityLevel();
			this.owner = topic.getOwner();
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getPostDate() {
		return postDate;
	}

	public void setPostDate(Date postDate) {
		this.postDate = postDate;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	
	public VisibilityLevel getVisibilityLevel() {
		return visibilityLevel;
	}

	public void setVisibilityLevel(VisibilityLevel visibilityLevel) {
		this.visibilityLevel = visibilityLevel;
	}

	
	public IUser getOwner() {
		return owner;
	}

	public void setOwner(IUser owner) {
		this.owner = owner;
	}

	public String toString() {
		return new StringBuffer()
		.append("{id=").append(id).append("\n")
		.append("title=").append(title).append("\n")
		.append("postDate=").append(postDate).append("\n")
		.append("content=").append(content).append("\n")
		.append("visibilityLevel=").append(visibilityLevel).append("\n")
		.append("owner=").append(owner).append("\n")
		.append("}")
		.toString();
	}
}
